﻿@model IEnumerable<Data.Web.News> 
@{
    var Media = System.Configuration.ConfigurationManager.AppSettings["Media"];
    }
<p>
   
   @using (Html.BeginForm(FormMethod.Get))
   { 
        @Html.ActionLink("Đăng tin mới", "Create")
       @Html.DropDownList("CateId")
       <input type="submit"  value="Tìm kiếm" /> 
   }
</p>
<table class="table table-bordered">
    <tr>
        <th>
            Danh mục
        </th>
        <th>
           Tiêu đế
        </th>
        <th>Mô tả</th>        
        <th>
            Ngày tạo
        </th>       
        <th>
            Ảnh 
        </th>
        <th>
            Trạng thái
        </th>
        <th>
            Xắp xếp
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.CateName)
        </td>
        <td>
             @Html.ActionLink(item.Title, "Details", new { id=item.Id }) 
        </td> 
        <td>@item.Description</td>
        <td>
            @Html.DisplayFor(modelItem => item.DateCreate)
        </td> 
        <td>
            @if (!string.IsNullOrEmpty(item.Image)) { 
            <img src="@Html.Raw(Media+"Thumbnail/"+item.Image)" style="max-height:50px;" />          
            }
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Satus)
        </td>
           <td>
            @Html.DisplayFor(modelItem => item.Orderby)
        </td>
        <td>
            @Html.ActionLink("Sửa", "Edit", new { id=item.Id })  
            
            @Html.ActionLink("Xóa", "Delete", new { id=item.Id })
        </td>
    </tr>
}

</table>
